package com.org.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.org.mapper.AdminMapper;
import com.org.pojo.Admin;
import com.org.service.AdminService;
import com.org.utils.ThreadLocalUtil;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * ClassName: AdminServiceImpl
 * Package: com.org.service.impl
 * Description:
 *
 * @Author Origin
 * @Create 2024/2/3 19:06
 * @Version 1.0
 */

@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public Admin findByUserName(String username) {
        Admin admin = adminMapper.findByUserName(username);
        return admin;
    }

    @Override
    public void updateAvatar(String url) {
        Map<String, Object> map = ThreadLocalUtil.get();
        Integer id = (Integer) map.get("id");
    }
}
